import request from '@/assets/common/js/utils/request';
/**
 * @description 获取设备列表分页数据
 * @param not
 * @return not
 * @author qiankui 2023-5-6 10:12:48
 **/
export function deviceversionGetlist(data) {
    return request({
        url: 'deviceversion/getlist',
        method: 'post',
        data: data,
    });
}
/**
 * @description 查询版本升级详情
 * @param not
 * @return not
 * @author qiankui 2024-6-17 11:29:52
 **/
export function deviceversionSearchdeviceupgradedetails(data) {
    return request({
        url: 'deviceversion/searchdeviceupgradedetails',
        method: 'post',
        data: data,
    });
}
/**
 * @description 重新下发让设备版本升级
 * @param not
 * @return not
 * @author qiankui 2024-6-14 20:11:24
 **/
export function deviceversionRetrysend(data) {
    return request({
        url: 'deviceversion/retrysend',
        method: 'post',
        data: data,
    });
}

/**
 * @description 获取所有在线设备
 * @param not
 * @return not
 * @author qiankui 2023-5-6 13:38:25
 **/
export function deviceinfoGetallonlinedevices() {
    return request({
        url: 'deviceinfo/getallonlinedevices',
        method: 'get'
    });
}

/**
 * @description 根据不同设备获取对应的在线设备
 * @param not
 * @return not
 * @author qiankui 2023-6-3 14:53:03
 **/
export function deviceinfoGetallonlinedevicesbydevicetype(deviceTypes) {
    return request({
        url: 'deviceinfo/getallonlinedevicesbydevicetype?deviceTypes='+deviceTypes,
        method: 'get'
    });
}

/**
 * @description 向设备获取抓拍图片
 * @param not
 * @return not
 * @author qiankui 2023-12-29 14:54:05
 **/
export function deviceinfoGetimagefromdevice(params) {
    return request({
        url: 'deviceinfo/getimagefromdevice',
        method: 'get',
        params:params
    });
}

/**
 * @description 创建升级数据
 * @param Object: {data} 接口请求参数
 * @return
 * @author qiankui 2023-5-6 17:41:44
 **/
export function deviceversionCreate(data) {
    return request({
        url: "deviceversion/create",
        method: "post",
        data: data,
    })
}

/**
 * @description 更新数据
 * @param not
 * @return not
 * @author qiankui 2023-4-25 10:23:55
 **/
export function deviceversionUpdate(data) {
    return request({
        url: `deviceversion/update/${data.id}`,
        method: 'put',
        data: data,
    });
}
/**
 * @description 修改描述信息
 * @param not
 * @return not
 * @author qiankui 2023-5-10 14:18:03
 **/
export function deviceversionUpdatadescription(data) {
    var  form = new FormData();
    form.append("description",data.description)
    return request({
        url: `deviceversion/updatadescription/${data.id}`,
        method: 'put',
        data: form,
    });
}
